home *** CD-ROM | disk | FTP | other *** search
- ' This QuickBASIC program tests the SAY() pure-code resource routine.
- ' Copyright (C)1988 by William H. Ball for MacTutor™ magazine.
-
- ' Usage: SAY(rate,pitch,string-expression)
-
- ' Beware! Will bomb with wrong number or type of arguments! Make sure
- ' MacinTalk is on the same volume, or SAY() will not talk.
-
- DEFINT a-z
- LIBRARY "Speechd.lib"
- ON ERROR GOTO 9
- PRINT "Let's test the SAY() routine:"
- GOSUB talk
- 9 LIBRARY CLOSE
- END
-
- talk:
- rate = 0 ' declare integer and string variables
- pitch = 0
- message$ = ""
-
- INPUT "Enter something to say: ";message$
- INPUT "Enter a rate of speech between 0 and 425";rate
- INPUT "Enter a pitch of speech between 0 and 500";pitch
-
- ' Just hit Return? Use a default value
- IF rate = 0 THEN rate = 100
- IF pitch = 0 THEN pitch = 100
-
- CALL SAY(rate,pitch,message$)
-
- PRINT "another?"
- message$=INPUT$(1)
- IF LEFT$(message$,1) = "y" THEN
- GOSUB talk
- END IF
- RETURN
-
-